package com.asj.house.controller;

import com.asj.house.client.HouseHitsClient;
import com.asj.house.returns.RespEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("house-hits")
@Api(value = "房源点击量接口", tags = "房源点击量接口")
@Slf4j
public class HouseHitsController {

    @Resource
    private HouseHitsClient houseHitsClient;

    @PostMapping("/access")
    @ApiOperation(value = "房源点击量异步数据接入")
    @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "roomId", value = "房源id", required = true)
    public RespEntity listIntermediary(@RequestParam(value = "roomId", required = true) Integer roomId) {
        RespEntity respEntity = houseHitsClient.houseHitsAccess(roomId);
        return respEntity;
    }

}
